//
//  LSZComposeMenuButton.swift
//  醒浪微博
//
//  Created by 雷顺哲 on 16/7/17.
//  Copyright © 2016年 LSZ. All rights reserved.
//

import UIKit

class LSZComposeMenuButton: UIButton {
    
//    持有跳转的控制器模型
    var composeMenu: LSZComposeMenu?
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setUpUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    private func setUpUI() {
        
        titleLabel?.font = UIFont.systemFontOfSize(15)
        setTitleColor(UIColor.grayColor(), forState: .Normal)
        
        titleLabel?.textAlignment = .Center
    }
    
//    重写highlighted属性,取消高亮状态
   override var highlighted: Bool {
        get {
            return false
        }
        set {
            
        }
    }
    
//    调整子控件布局
    override func layoutSubviews() {
        super.layoutSubviews()
        
        
        imageView?.y = 0
        imageView?.width = width
        imageView?.height = width
        
        
        titleLabel?.x = 0
        titleLabel?.y = width
        titleLabel?.width = width
        titleLabel?.height = height - width
    }
    
    
}
